home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-29 | 524 b | 32 lines | [TEXT/KAHL] |
- #include <Palettes.h>
-
- #include "depthChange.h"
-
- depthChange::depthChange() : oldDepth( 0)
- {
- theGDHandle = 0;
- }
-
- depthChange::depthChange( int newDepth, GDHandle aGDHandle)
- : oldDepth( (**(**aGDHandle).gdPMap).pixelSize)
- {
- if( newDepth == oldDepth)
- {
- theGDHandle = 0;
- } else {
- theGDHandle = aGDHandle;
- }
- if( SetDepth( aGDHandle, newDepth, 0x0001, 0x0001) != noErr)
- {
- theGDHandle = 0;
- }
- }
-
- depthChange::~depthChange()
- {
- if( theGDHandle != 0)
- {
- (void)SetDepth( theGDHandle, oldDepth, 0x0001, 0x0001);
- }
- }
-